using System;

using IGlobalist.Chat.Engine.Common;

namespace IGlobalist.Chat.Engine
{
	public class User:IDisposable
	{

		#region Members
		private string _ID;
        private string _UserName;
        private bool _IsActive;
        private DateTime _LastSeen;
        private int _LastMessageReceived;
        private string _Password;

        
        private UserStatus _Status= UserStatus.Online;
        
        private UserType _Type = UserType.Guest;

        
		#endregion 

        #region Properties
        public string ID
        {
            get { return _ID; }
            set{_ID=value;}
        }

        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }

        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }

        public bool IsActive
        {
            get { return _IsActive; }
            set { _IsActive = value; }
        }

        public DateTime LastSeen
        {
            get { return _LastSeen; }
            set { _LastSeen = value; }
        }

        public int LastMessageReceived
        {
            get { return _LastMessageReceived; }
            set { _LastMessageReceived = value; }
        }
        public UserStatus Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        public UserType Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        #endregion




        #region Constructors
        public User(string id,string userName)
		{
			_ID=id;
			_IsActive=false;
			_LastSeen=DateTime.MinValue ;
			_UserName=userName;
			_LastMessageReceived=0;
		}

        public User(string id, string userName, UserType type)
        {
            _ID = id;
            _IsActive = false;
            _Type = type;
            _LastSeen = DateTime.MinValue;
            _UserName = userName;
            _LastMessageReceived = 0;
        }
		#endregion 

		#region IDisposable Members
		public void Dispose()
		{
			_ID="";
			_IsActive=false;
			_LastSeen=DateTime.MinValue ;
			_UserName="";
			_LastMessageReceived=0;
            _ID = "";
            _Status = UserStatus.Offline;
            _Type = UserType.Guest;
		}
		#endregion
	}

	
}
